package com.hbnu.dao;

import com.hbnu.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {

    @Insert("insert into tb_user(name, password, gender, address, account) values(#{name}, #{password}, #{gender}, #{address}, #{account})")
    public abstract void addData3(User user);

//    @Update("update tb_user set account = #{param1} where name = #{param2}")
//    @Update("update tb_user set account = #{arg0} where name = #{arg1}")
//    void updateData3(User user);
    @Update("update tb_user set account = #{account1} where name = #{name1}")
    void updateData3(@Param("account1") Double account,@Param("name1") String name);


    @Delete("delete from tb_user where id = #{id}")
    void deleteData3(int id);

    @Select("select * from tb_user where id = #{id}")
    User findById3(int id);

    @Select("select * from tb_user")
    List<User> findAllUser3();

}
